﻿using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data.SqlClient;
using System.IO;
using System.Linq;
using System.Text;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;

public partial class Print : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        string document_id;
        Response.Write(document_id = Session["Doc_ID"].ToString());

        SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["ApplicationServices"].ConnectionString);

        lbldoc_num.Text = _Invoice.ViewInvoice(document_id).document_number;
        lbldoc_date.Text = _Invoice.ViewInvoice(document_id).document_date.ToString("yyyy.MM.dd");
        lblpay_date.Text = _Invoice.ViewInvoice(document_id).document_payment_date.ToString("yyyy.MM.dd");
        lbl_user.Text = _Invoice.ViewInvoice(document_id).issued_by_user;
        lblcompany_by.Text = _Invoice.ViewInvoice(document_id).company_issued_by;
        int company_by_id = _Invoice.ViewInvoice(document_id).id_company_issued_by;
        lblcompany_to.Text = _Invoice.ViewInvoice(document_id).client_issued_to;
        int company_to_id = _Invoice.ViewInvoice(document_id).id_client_issued_to;
        //lbldoc_path.Text = _Invoice.ViewInvoice(document_id).document_path;
        lbldoc_type.Text = _Invoice.ViewInvoice(document_id).document_type;
        lblpay_type.Text = _Invoice.ViewInvoice(document_id).payment_type;

        Response.Clear();

        Response.Write("<script>window.print();</script>");
    }
}
